# $Id: mt-dump_cf.pl 2 2009-07-11 04:35:20Z taketoshi.y $

package MT::Plugin::DumpCF;

use strict;
use MT::Plugin;
@MT::Plugin::DumpCF::ISA = qw(MT::Plugin);


use Data::Dumper;

use vars qw($PLUGIN_NAME $VERSION);
$PLUGIN_NAME = 'DumpCF';
$VERSION = '';

use MT;
my $plugin = new MT::Plugin::DumpCF({
    name => $PLUGIN_NAME,
    version => $VERSION,
    description => "<MT_TRANS phrase='description of DumpCF'>",
    author_name => '',
    author_link => '',
    l10n_class => 'DumpCF::L10N',
});

MT->add_plugin($plugin);

sub init_registry {
    my $plugin = shift;
    $plugin->registry({
    });
}

#----- Hook
MT->add_callback('CMSPostSave.entry', 9, $plugin, \&hdlr_cms_post_save_entry);


sub instance { $plugin; }

sub doLog {
    my ($msg) = @_; 
    return unless defined($msg);

    use MT::Log;
    my $log = MT::Log->new;
    $log->message($msg) ;
    $log->save or die $log->errstr;
}

#----- Hook

sub hdlr_cms_post_save_entry {
    my ($cb, $app, $obj) = @_;

    my $q = $app->param;
    doLog(Dumper($q));
    doLog($q->param('title'));
    1;
}


1;